Nested ifs

Problem#1: Find the minimum of three values

Example#1: MinOfThreeV2.java

- switch

if 
else if 
else if
else 

replace them with a switch

Problem#2: Get a grade from the user and print a message out 
100 ---> perfect score
90s ---> well above average
80s ---> above average
70s ---> average
60s ---> below average
< 60 ---> Not passing

Example#2: GradeReport.java

switch(.....) {
case ...:

case ...:

default:

}

char letter = 'A';
int countA = 0, countB = 0, other = 0;
switch(letter) { // byte, short, int, char, String
case 'A':
	countA++;
	break;
case 'B':
	countB++;
	break;
default:
	other++;
}

91 / 10 = 9 -- 92 % 10 = 2
90 - 99: / 10 = 9

--------------------------------------------------------------------------------
Repetition statements: while, do while, for

int counter = 1;
while(counter <= 5) {
	System.out.println(counter);
	counter++;
} 
System.out.println("End");

counter		output
----------------------
1		1
2		2
3		3
4		4
5		5
6

Example#3: WhileDemo.java

Example#4: InfiniteLoop.java
Example#5: BreakDemo.java
Example#6: ContinueDemo.java

!(counter != 5 && counter != 6) <=> counter == 5 || counter == 6

Example#7: Average.java

Sentinel value: 0 to quit

Example#8: AverageVariant.java

Problem #3: Palindrome.java

r	a	d	a	r
			left		
	right















